import { Environment } from './env'

import { JsonRequest } from './request'

import controller from './controllers'
const { web } = controller

export class RPC {
  constructor() {}

  static init({ baseURL, timeout }) {
    JsonRequest.baseURL = baseURL
    JsonRequest.timeout = timeout
  }

  static get env() {
    return new Environment()
  }
}

const rpc = RPC
rpc.web = web

export default rpc
